<?php
/**
 * Created by PhpStorm.
 * User: lili
 * Date: 2018/11/21
 * Time: 14:04
 */

namespace app\admin\model;


use think\Model;
use traits\model\SoftDelete;

class Admin extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;


    /*
     * 搜索所有的用户
     *
     * */
    public function getAllUser(){



        $admins = $this->field('aid,username')->select();

        //$users = $this->query($sql);
        return $admins;
    }


    /*
     *
     * 通过uid获得用户
     *
     *
     * */

    public function getUserByuid($aid){
        $w['aid'] = $aid;
        $admins = $this->field('aid,username')->where($w)->find();
        return $admins;
    }

}